
********************************************************************************
*Table 6; Panel A; Column 1 
********************************************************************************
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/estimation_sample_blacks, clear

preserve
gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}

reg tobacco $treat_var $state_var i.age_cat i.tbo i.male i.year i.birth_month i.division#c.by i.by i.mom_birth_state, cluster(mom_birth_state)

local Z=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
lincom (_b[Post0]*meanPost0/`Z')+(_b[Post1]*meanPost1/`Z')+(_b[Post2]*meanPost2/`Z')+(_b[Post3]*meanPost3/`Z')+(_b[Post4]*meanPost4/`Z')
restore
********************************************************************************

set seed 23260513
capture postclose placebo		  
postfile placebo b using "$data/table_6_panela_c1", replace
forvalues i=1/500 {
use $data/estimation_sample_blacks, clear

preserve
bsample, cluster(mom_birth_state)

gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}
qui reg tobacco $treat_var $state_var i.age_cat  i.tbo i.male i.year i.birth_month i.division#c.by i.by i.mom_birth_state 
local V=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
local c_weighted=(_b[Post0]*meanPost0/`V')+(_b[Post1]*meanPost1/`V')+(_b[Post2]*meanPost2/`V')+(_b[Post3]*meanPost3/`V')+(_b[Post4]*meanPost4/`V')
post placebo (`c_weighted')
restore
}

postclose placebo

use table_6_panela_c1, clear

sum  /****Std Dev is the standard error of the weighted point estimate.*/

********************************************************************************
*Table 6; Panel A; Column 2 
********************************************************************************
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/estimation_sample_blacks, clear

preserve
gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}

reg educ13_more $treat_var $state_var i.age_cat i.tbo i.male i.year i.birth_month i.division#c.by i.by i.mom_birth_state, cluster(mom_birth_state)

local Z=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
lincom (_b[Post0]*meanPost0/`Z')+(_b[Post1]*meanPost1/`Z')+(_b[Post2]*meanPost2/`Z')+(_b[Post3]*meanPost3/`Z')+(_b[Post4]*meanPost4/`Z')
restore
*********************************************************************************

set seed 23260513
capture postclose placebo		  
postfile placebo b using "$data/table_6_panela_c2", replace
forvalues i=1/500 {
use $data/estimation_sample_blacks, clear



preserve
bsample, cluster(mom_birth_state)

gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}
qui reg educ13_more $treat_var $state_var i.age_cat  i.tbo i.male i.year i.birth_month i.division#c.by i.by i.mom_birth_state 
local V=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
local c_weighted=(_b[Post0]*meanPost0/`V')+(_b[Post1]*meanPost1/`V')+(_b[Post2]*meanPost2/`V')+(_b[Post3]*meanPost3/`V')+(_b[Post4]*meanPost4/`V')
post placebo (`c_weighted')
restore
}

postclose placebo

use table_6_panela_c2, clear

sum  /****Std Dev is the standard error of the weighted point estimate.*/

********************************************************************************
*Table 6; Panel A; Column 3 
********************************************************************************
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/acs_census_estimation_sample_blacks, clear


*Family Income
egen zL_FamilyIncome= std(L_FamilyIncome)

*Any Public Assistance
gen pub_ass=1-any_public_ass
egen zany_public_ass= std(pub_ass)

*labor force participation
egen zlfp= std(lfp)

*composite measure
egen ssi1=rmean(zany_public_ass zL_FamilyIncome zlfp)

preserve
gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}


reg ssi1    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ], cluster(mom_birth_state)
sum ssi1 if e(sample)==1&T==0
local Z=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
lincom (_b[Post0]*meanPost0/`Z')+(_b[Post1]*meanPost1/`Z')+(_b[Post2]*meanPost2/`Z')+(_b[Post3]*meanPost3/`Z')+(_b[Post4]*meanPost4/`Z')
restore
********************************************************************************

set seed 23260513
capture postclose placebo		  
postfile placebo b using "$data/table_6_panela_c3", replace
forvalues i=1/500 {
use $data/acs_census_estimation_sample_blacks, clear


*Family Income
egen zL_FamilyIncome= std(L_FamilyIncome)

*Any Public Assistance
gen pub_ass=1-any_public_ass
egen zany_public_ass= std(pub_ass)

*labor force participation
egen zlfp= std(lfp)

*composite measure
egen ssi1=rmean(zany_public_ass zL_FamilyIncome zlfp)

preserve
bsample, cluster(mom_birth_state)

gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}

qui reg ssi1    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ]
local V=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
local c_weighted=(_b[Post0]*meanPost0/`V')+(_b[Post1]*meanPost1/`V')+(_b[Post2]*meanPost2/`V')+(_b[Post3]*meanPost3/`V')+(_b[Post4]*meanPost4/`V')
post placebo (`c_weighted')
restore
}

postclose placebo

use table_6_panela_c3, clear

sum  /****Std Dev is the standard error of the weighted point estimate.*/


********************************************************************************
*Table 6; Panel A; Column 4 
********************************************************************************
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/acs_census_estimation_sample_blacks, clear


preserve
gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}

reg L_FamilyIncome    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ], cluster(mom_birth_state)
sum L_FamilyIncome if e(sample)==1&T==0
local Z=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
lincom (_b[Post0]*meanPost0/`Z')+(_b[Post1]*meanPost1/`Z')+(_b[Post2]*meanPost2/`Z')+(_b[Post3]*meanPost3/`Z')+(_b[Post4]*meanPost4/`Z')
restore
********************************************************************************
set seed 23260513
capture postclose placebo		  
postfile placebo b using "$data/table_6_panela_c4", replace
forvalues i=1/500 {
use $data/acs_census_estimation_sample_blacks, clear


preserve
bsample, cluster(mom_birth_state)

gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}



qui reg L_FamilyIncome    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ]
local V=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
local c_weighted=(_b[Post0]*meanPost0/`V')+(_b[Post1]*meanPost1/`V')+(_b[Post2]*meanPost2/`V')+(_b[Post3]*meanPost3/`V')+(_b[Post4]*meanPost4/`V')
post placebo (`c_weighted')
restore
}

postclose placebo

use table_6_panela_c4, clear

sum  /****Std Dev is the standard error of the weighted point estimate.*/
log close

********************************************************************************
*Table 6; Panel A; Column 5 
********************************************************************************
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/acs_census_estimation_sample_blacks, clear

preserve
gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}


reg any_public_ass    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ], cluster(mom_birth_state)
sum any_public_ass if e(sample)==1&T==0
local Z=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
lincom (_b[Post0]*meanPost0/`Z')+(_b[Post1]*meanPost1/`Z')+(_b[Post2]*meanPost2/`Z')+(_b[Post3]*meanPost3/`Z')+(_b[Post4]*meanPost4/`Z')
restore
********************************************************************************

set seed 23260513
capture postclose placebo		  
postfile placebo b using "$data/table_6_panela_c5", replace
forvalues i=1/500 {
use $data/acs_census_estimation_sample_blacks, clear

preserve
bsample, cluster(mom_birth_state)

gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}

qui reg any_public_ass    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ]
local V=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
local c_weighted=(_b[Post0]*meanPost0/`V')+(_b[Post1]*meanPost1/`V')+(_b[Post2]*meanPost2/`V')+(_b[Post3]*meanPost3/`V')+(_b[Post4]*meanPost4/`V')
post placebo (`c_weighted')
restore
}

postclose placebo

use table_6_panela_c5, clear

sum  /****Std Dev is the standard error of the weighted point estimate.*/


********************************************************************************
*Table 6; Panel A; Column 6 
********************************************************************************
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/acs_census_estimation_sample_blacks, clear

preserve
gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}


reg lfp    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ], cluster(mom_birth_state)
sum lfp if e(sample)==1&T==0
local Z=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
lincom (_b[Post0]*meanPost0/`Z')+(_b[Post1]*meanPost1/`Z')+(_b[Post2]*meanPost2/`Z')+(_b[Post3]*meanPost3/`Z')+(_b[Post4]*meanPost4/`Z')
restore
********************************************************************************

set seed 23260513
capture postclose placebo		  
postfile placebo b using "$data/table_6_panela_c6", replace
forvalues i=1/500 {
use $data/acs_census_estimation_sample_blacks, clear



preserve
bsample, cluster(mom_birth_state)

gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}

qui reg lfp   $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ]
local V=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
local c_weighted=(_b[Post0]*meanPost0/`V')+(_b[Post1]*meanPost1/`V')+(_b[Post2]*meanPost2/`V')+(_b[Post3]*meanPost3/`V')+(_b[Post4]*meanPost4/`V')
post placebo (`c_weighted')
restore
}

postclose placebo



use table_6_panela_c6, clear

sum  /****Std Dev is the standard error of the weighted point estimate.*/


********************************************************************************
*Table 6; Panel B; Column 1 
********************************************************************************
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/estimation_sample_whites, clear

preserve
gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}

reg tobacco $treat_var $state_var i.age_cat i.tbo i.male i.year i.birth_month i.division#c.by i.by i.mom_birth_state, cluster(mom_birth_state)

local Z=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
lincom (_b[Post0]*meanPost0/`Z')+(_b[Post1]*meanPost1/`Z')+(_b[Post2]*meanPost2/`Z')+(_b[Post3]*meanPost3/`Z')+(_b[Post4]*meanPost4/`Z')
restore
********************************************************************************

set seed 23260513
capture postclose placebo		  
postfile placebo b using "$data/table_6_panelb_c1", replace
forvalues i=1/500 {
use $data/estimation_sample_whites, clear



preserve
bsample, cluster(mom_birth_state)

gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}
qui reg tobacco $treat_var $state_var i.age_cat  i.tbo i.male i.year i.birth_month i.division#c.by i.by i.mom_birth_state 
local V=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
local c_weighted=(_b[Post0]*meanPost0/`V')+(_b[Post1]*meanPost1/`V')+(_b[Post2]*meanPost2/`V')+(_b[Post3]*meanPost3/`V')+(_b[Post4]*meanPost4/`V')
post placebo (`c_weighted')
restore
}

postclose placebo

use table_6_panelb_c1, clear

sum  /****Std Dev is the standard error of the weighted point estimate.*/

********************************************************************************
*Table 6; Panel B; Column 2 
********************************************************************************
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/estimation_sample_whites, clear

preserve
gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}

reg educ13_more $treat_var $state_var i.age_cat i.tbo i.male i.year i.birth_month i.division#c.by i.by i.mom_birth_state, cluster(mom_birth_state)

local Z=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
lincom (_b[Post0]*meanPost0/`Z')+(_b[Post1]*meanPost1/`Z')+(_b[Post2]*meanPost2/`Z')+(_b[Post3]*meanPost3/`Z')+(_b[Post4]*meanPost4/`Z')
restore
*********************************************************************************

set seed 23260513
capture postclose placebo		  
postfile placebo b using "$data/table_6_panelb_c2", replace
forvalues i=1/500 {
use $data/estimation_sample_whites, clear



preserve
bsample, cluster(mom_birth_state)

gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}
qui reg educ13_more $treat_var $state_var i.age_cat  i.tbo i.male i.year i.birth_month i.division#c.by i.by i.mom_birth_state 
local V=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
local c_weighted=(_b[Post0]*meanPost0/`V')+(_b[Post1]*meanPost1/`V')+(_b[Post2]*meanPost2/`V')+(_b[Post3]*meanPost3/`V')+(_b[Post4]*meanPost4/`V')
post placebo (`c_weighted')
restore
}

postclose placebo

use table_6_panelb_c2, clear

sum  /****Std Dev is the standard error of the weighted point estimate.*/

********************************************************************************
*Table 6; Panel B; Column 3 
********************************************************************************
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/acs_census_estimation_sample_whites, clear


*Family Income
egen zL_FamilyIncome= std(L_FamilyIncome)

*Any Public Assistance
gen pub_ass=1-any_public_ass
egen zany_public_ass= std(pub_ass)

*labor force participation
egen zlfp= std(lfp)

*composite measure
egen ssi1=rmean(zany_public_ass zL_FamilyIncome zlfp)

preserve
gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}


reg ssi1    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ], cluster(mom_birth_state)
sum ssi1 if e(sample)==1&T==0
local Z=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
lincom (_b[Post0]*meanPost0/`Z')+(_b[Post1]*meanPost1/`Z')+(_b[Post2]*meanPost2/`Z')+(_b[Post3]*meanPost3/`Z')+(_b[Post4]*meanPost4/`Z')
restore
********************************************************************************

set seed 23260513
capture postclose placebo		  
postfile placebo b using "$data/table_6_panelb_c3", replace
forvalues i=1/500 {
use $data/acs_census_estimation_sample_whites, clear


*Family Income
egen zL_FamilyIncome= std(L_FamilyIncome)

*Any Public Assistance
gen pub_ass=1-any_public_ass
egen zany_public_ass= std(pub_ass)

*labor force participation
egen zlfp= std(lfp)

*composite measure
egen ssi1=rmean(zany_public_ass zL_FamilyIncome zlfp)


preserve
bsample, cluster(mom_birth_state)

gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}

qui reg ssi1    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ]
local V=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
local c_weighted=(_b[Post0]*meanPost0/`V')+(_b[Post1]*meanPost1/`V')+(_b[Post2]*meanPost2/`V')+(_b[Post3]*meanPost3/`V')+(_b[Post4]*meanPost4/`V')
post placebo (`c_weighted')
restore
}

postclose placebo

use table_6_panelb_c3, clear

sum  /****Std Dev is the standard error of the weighted point estimate.*/


********************************************************************************
*Table 6; Panel B; Column 4 
********************************************************************************
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/acs_census_estimation_sample_whites, clear


preserve
gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}


reg L_FamilyIncome    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ], cluster(mom_birth_state)
sum L_FamilyIncome if e(sample)==1&T==0
local Z=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
lincom (_b[Post0]*meanPost0/`Z')+(_b[Post1]*meanPost1/`Z')+(_b[Post2]*meanPost2/`Z')+(_b[Post3]*meanPost3/`Z')+(_b[Post4]*meanPost4/`Z')
restore
********************************************************************************
set seed 23260513
capture postclose placebo		  
postfile placebo b using "$data/table_6_panelb_c4", replace
forvalues i=1/500 {
use $data/acs_census_estimation_sample_whites, clear


preserve
bsample, cluster(mom_birth_state)

gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}

qui reg L_FamilyIncome    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ]
local V=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
local c_weighted=(_b[Post0]*meanPost0/`V')+(_b[Post1]*meanPost1/`V')+(_b[Post2]*meanPost2/`V')+(_b[Post3]*meanPost3/`V')+(_b[Post4]*meanPost4/`V')
post placebo (`c_weighted')
restore
}

postclose placebo

use table_6_panelb_c4, clear

sum  /****Std Dev is the standard error of the weighted point estimate.*/
log close

********************************************************************************
*Table 6; Panel B; Column 5 
********************************************************************************
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/acs_census_estimation_sample_whites, clear

preserve
gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}


reg any_public_ass    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ], cluster(mom_birth_state)
sum any_public_ass if e(sample)==1&T==0
local Z=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
lincom (_b[Post0]*meanPost0/`Z')+(_b[Post1]*meanPost1/`Z')+(_b[Post2]*meanPost2/`Z')+(_b[Post3]*meanPost3/`Z')+(_b[Post4]*meanPost4/`Z')
restore
********************************************************************************

set seed 23260513
capture postclose placebo		  
postfile placebo b using "$data/table_6_panelb_c5", replace
forvalues i=1/500 {
use $data/acs_census_estimation_sample_whites, clear

preserve
bsample, cluster(mom_birth_state)

gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}

qui reg any_public_ass    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ]
local V=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
local c_weighted=(_b[Post0]*meanPost0/`V')+(_b[Post1]*meanPost1/`V')+(_b[Post2]*meanPost2/`V')+(_b[Post3]*meanPost3/`V')+(_b[Post4]*meanPost4/`V')
post placebo (`c_weighted')
restore
}

postclose placebo

use table_6_panelb_c5, clear

sum  /****Std Dev is the standard error of the weighted point estimate.*/


********************************************************************************
*Table 6; Panel B; Column 6 
********************************************************************************
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/acs_census_estimation_sample_whites, clear

preserve
gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}


reg lfp    $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ], cluster(mom_birth_state)
sum lfp if e(sample)==1&T==0
local Z=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
lincom (_b[Post0]*meanPost0/`Z')+(_b[Post1]*meanPost1/`Z')+(_b[Post2]*meanPost2/`Z')+(_b[Post3]*meanPost3/`Z')+(_b[Post4]*meanPost4/`Z')
restore
********************************************************************************

set seed 23260513
capture postclose placebo		  
postfile placebo b using "$data/table_6_panelb_c6", replace
forvalues i=1/500 {
use $data/acs_census_estimation_sample_whites, clear


preserve
bsample, cluster(mom_birth_state)

gen Post0=0
replace Post0=1 if index==0

gen Post1=0
replace Post1=1 if index==1

gen Post2=0
replace Post2=1 if index==2

gen Post3=0
replace Post3=1 if index==3

gen Post4=0
replace Post4=1 if index>=4


global treat_var "Post0 Post1 Post2 Post3 Post4"
global state_var "Exitexam Perstudentexpenditure Studentteacherratio Povertyrate Unemploymentrate"
foreach x in $treat_var{
sum `x', meanonly
scalar mean`x'=r(mean)
}

qui reg lfp   $treat_var $state_var i.age_cat i.year i.by i.mom_birth_state   i.division#c.by  [aw=perwt ]
local V=meanPost0+meanPost1+meanPost2+meanPost3+meanPost4
local c_weighted=(_b[Post0]*meanPost0/`V')+(_b[Post1]*meanPost1/`V')+(_b[Post2]*meanPost2/`V')+(_b[Post3]*meanPost3/`V')+(_b[Post4]*meanPost4/`V')
post placebo (`c_weighted')
restore
}

postclose placebo



use table_6_panelb_c6, clear

sum  /****Std Dev is the standard error of the weighted point estimate.*/

